<!--{template common/header_simple_start}-->
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
<link href="dzz/corpus/images/popbox.css?{VERHASH}" rel="stylesheet" media="all">
<link href="dzz/corpus/images/corpus.css?{VERHASH}" rel="stylesheet" media="all">
<script type="text/javascript" src="dzz/corpus/scripts/main.js?{VERHASH}"></script>
<!--{template common/header_simple_end}-->
<!--{template common/commer_header}-->
<style>
	.window-module-archive .window-module-title{
	margin-top:10px;
	margin-bottom:10px;
	margin-right:10px;
}
	.form-horizontal .form-group {
    margin-left: 0px;
}
label.checked{
	color:#d43f3a;
}
.image-item{
	position:relative;
	margin-bottom:10px;
}

.complain-wrap li {
    line-height: 24px;
    color: #666;
	font-size:12px
}
.icon-lg{
  line-height:30px;
}
.window-module-archive h2{
	height:30px;
	line-height:30px;
	text-align: center;
}
.main-content {
    padding:10px;
    overflow-y: auto;
    height: calc(100% - 64px);
}
.form-horizontal .form-group{
		margin: 0
	}
</style>
 <div class="main-content container clearfix">
   	<div id="archive_container" class="archive-container" >
    	 <div class="window-module window-module-archive">
         <h2>{lang report}</h2>
        <div class="u-gutter clearfix" style="padding-top:10px;">
          <form id="report_{$corpus['cid']}" class="form-horizontal" action="{DZZSCRIPT}?mod={MOD_NAME}&op=report" method="post" onsubmit="return validate(this)">
            <input type="hidden" name="reportsubmit" value="true" />
            <input type="hidden" name="formhash" value="{FORMHASH}" /> 
            <input type="hidden" name="cid" value="$corpus[cid]" /> 
            <div class="form-group">
               <h3 style="text-align: center">《<a href="{DZZSCRIPT}?mod={MOD_NAME}&op=list&cid=$corpus['cid']" target="_blank">$corpus[name]</a>》</h3>
            </div>
            <div class="form-group" >
             <p style="font-weight:bold">1、请选择举报类型</p> 
             <!--{loop $modreasons $key $value}-->
              <label class="checkbox-inline" style="margin-left:15px;margin-bottom:10px;"><input type="checkbox" class="js-report-item js-report-{$key}"  name="modreasons[]" value="$key" />$value</label>
              <!--{/loop}-->		 
            </div>
          </div>
           <div class="form-group">
            <p style="font-weight:bold">2、{lang detailed_description}:</p>
              <p><textarea name="detail" class="form-control" style="background:#FFF" rows="3" placeholder="{lang fill_in_your_details}"></textarea></p>
           </div>
          <p style="font-weight:bold">3、{lang upload_scanned_copy}</p>
					<div id="preview"></div>
            <div id="upload" class="addPhotoBar" style="position:relative;padding:10px;overflow:hidden;margin-bottom:10px;">
                <input class="btn btn-default" id="fileupload" name="files[]" tabIndex="-1" type="file" accept="image/png,image/gif,image/jpeg,image/bmp" multiple><span class="help-inline ml10">{lang only_JPG_jpeg_BMP_PNG_format_are_supported}</span>
            </div>
          <div class="form-group" style="text-align: center">
            <button class="btn btn-primary btn-width" type="submit">{lang immediately_report}</button>
           </div>
         </form>
       </div>
      </div>
    </div>
 </div>
<script type="text/javascript">
jQuery(document).ready(function(e) {
	 jQuery('#fileupload').fileupload({
			url: '{DZZSCRIPT}?mod={MOD_NAME}&op=ajax&do=imageupload',
			dataType: 'json',
			autoUpload: true,
			maxFileSize: null, // 2MB
			maxChunkSize:2000000, //2M
			acceptFileTypes:new RegExp("(\.|\/)([jpeg|jpg|gif|png|bmp])$",'i'),
			dropZone:jQuery('#upload'),
			pasteZone:jQuery('#upload'),
			sequentialUploads:true,
		   }).on('fileuploaddone', function (e, data) {
				jQuery.each(data.result.files, function (index, file) {
					console.log(file);
					jQuery('<div class="image-item"><input type="hidden" name="aid[]" value="'+file.data.aid+'"> <img class="thumbnail" style="margin-bottom:0;max-width:100%;max-height:200px;" src="'+file.data.img+'" /><a href="javascript:;" style="position:absolute;left:0;top:0;" class="ibtn glyphicon glyphicon-remove" title="{lang remove_image}" onclick="remove_image(this)"></a></div>').appendTo('#preview');
				});
			});
});
function remove_image(obj){
	jQuery(obj).parent().remove();
	return false;
}
function validate(form){
	console.log(form);
	console.log(form.modreasons);
	if(jQuery('.js-report-item:checked').length<1){
		showmessage(__lang.choose_infringement,'danger',3000,1);
		return false;
	}
}
 
</script>
<script  type="text/javascript" src="dzz/corpus/scripts/jquery.popbox.js?{VERHASH}"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script type="text/javascript" src="static/jquery_file_upload/jquery.ui.widget.js?{VERHASH}"></script>
<script type="text/javascript" src="static/jquery_file_upload/jquery.iframe-transport.js?{VERHASH}"></script>
<!-- The basic File Upload plugin -->
<script type="text/javascript" src="static/jquery_file_upload/jquery.fileupload.js?{VERHASH}"></script>
<script type="text/javascript" src="static/jquery_file_upload/jquery.fileupload-process.js?{VERHASH}"></script>
<script type="text/javascript" src="static/jquery_file_upload/jquery.fileupload-validate.js?{VERHASH}"></script>
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
<!--codestrings-->
<!--{template common/footer_simple}--> 